clear all
cap log close
set more off
clear mata 
clear matrix 

/*******************************************************************************


					  Replication of the results of

			 "Entrepreneurship Education and Teacher Training in Rwanda," 
					Stage 2 Registered report,  Journal of Development Economics

							 Moussa P. Blimpo
							   Todd Pugatch
								

*******************************************************************************/

********************************************************************************
* 						Install packages as needed 							   *
********************************************************************************
/*
	ssc install orthout
	ssc install outreg2
	ssc install estout
	ssc install leebounds
	ssc install winsor
*/

********************************************************************************
* 	Change main working directory to where the master do-file lives		   	   *
********************************************************************************

global main "[SET MAIN DIRECTORY HERE]"
	global rawdata "$main/01_data/01_raw"
	global cleandata "$main/01_data/02_clean"
	global dofiles "$main/02_dofiles"
	global results "$main/03_results"
	global temp "$main/04_output"

********************************************************************************
* 			Data cleaning: from cleaned raw to analysis 					   *
********************************************************************************

qui do "$dofiles/01_cleaning/01_rwanda_headteacher_baseline_jde.do"
/* 	Cleans head teacher baseline survey  */


qui do "$dofiles/01_cleaning/02_rwanda_headteacher_endline_jde.do" 
/*	Cleans head teacher endline survey */

qui do "$dofiles/01_cleaning/03_rwanda_teacher_baseline_jde.do"
/* Cleans teacher baseline survey */


qui do "$dofiles/01_cleaning/04_rwanda_teacher_endline_jde.do"
/* 	cleans teacher endline survey */ 

qui do "$dofiles/01_cleaning/05_rwanda_student_baseline_clean_jde.do"
/*	cleans student baseline survey */


qui do "$dofiles/01_cleaning/06_rwanda_student_endline_clean_jde.do"
/*	cleans student endline survey */

qui do "$dofiles/01_cleaning/07_rwanda_teacher_compliance_jde.do"
/*	cleans teacher administrative takeup data */

qui do "$dofiles/01_cleaning/08_rwanda_teacherobs_endline_jde.do"
/*	cleans teacher observation endline survey */

qui do "$dofiles/01_cleaning/09_rwanda_merge_jde.do"
/*	merges baseline and endline data */


*************************************************************************************
* 		Runs analysis dofiles, replicating the results from the paper 				*
*************************************************************************************


*----------------------------- Tables 1 - 8 ----------------------------------------*

* Table 1
do "$dofiles/02_analysis/01_rwanda_jde_table1.do"

* Table 2
do "$dofiles/02_analysis/02_rwanda_jde_table2.do"

* Table 3
do "$dofiles/02_analysis/03_rwanda_jde_table3.do"

* Table 4
do "$dofiles/02_analysis/04_rwanda_jde_table4.do"

* Tables 5-6
do "$dofiles/02_analysis/05_rwanda_jde_table5-6.do"

* Table 7
do "$dofiles/02_analysis/06_rwanda_jde_table7.do"

* Table 8
do "$dofiles/02_analysis/07_rwanda_jde_table8.do"


*----------------------------- Tables A1 - A18 ----------------------------------------*
do "$dofiles/02_analysis/08_rwanda_jde_tableA1.do"
/* 
Note: Uses Rwanda 2012 census data.
*/ 

* Tables A2-A3
do "$dofiles/02_analysis/09_rwanda_jde_tableA2-A3.do"


* Tables A4
do "$dofiles/02_analysis/10_rwanda_jde_tableA4.do"


* Tables A5-A6
do "$dofiles/02_analysis/11_rwanda_jde_tableA5-A6.do"


* Tables A7
do "$dofiles/02_analysis/12_rwanda_jde_tableA7.do"


* Tables A8
do "$dofiles/02_analysis/13_rwanda_jde_tableA8.do"


* Tables A9
do "$dofiles/02_analysis/14_rwanda_jde_tableA9.do"


* Tables A10-A11
do "$dofiles/02_analysis/15_rwanda_jde_tableA10-A11.do"


* Tables A12
do "$dofiles/02_analysis/16_rwanda_jde_tableA12.do"


* Tables A13
do "$dofiles/02_analysis/17_rwanda_jde_tableA13.do"


* Tables A14
do "$dofiles/02_analysis/18_rwanda_jde_tableA14.do"


* Tables A15
do "$dofiles/02_analysis/19_rwanda_jde_tableA15.do"


* Tables A16
do "$dofiles/02_analysis/20_rwanda_jde_tableA16-A17.do"


* Tables A17
do "$dofiles/02_analysis/21_rwanda_jde_tableA18.do"

